package com.sdtele.tta.models;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

public class TaskResponse {
    private long id;
    private long taskId;
    private long userId;
    private String response;
    private  Timestamp responseTime;
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getTaskId() {
		return taskId;
	}
	public void setTaskId(long taskId) {
		this.taskId = taskId;
	}
	public long getUserId() {
		return userId;
	}
	public void setUserId(long userId) {
		this.userId = userId;
	}
	public String getResponse() {
		return response;
	}
	public void setResponse(String response) {
		this.response = response;
	}
	public Timestamp getResponseTime() {
		return responseTime;
	}
	public void setResponseTime(Timestamp responseTime) {
		this.responseTime = responseTime;
	}
	@Override
	public String toString() {
		return "Response [id=" + id + ", taskId=" + taskId + ", userId=" + userId + ", response=" + response
				+ ", responseTime=" + responseTime + "]";
	}
    
	
	public TaskResponseOut ToTaskResponse() 
	{
		TaskResponseOut taskRes = new TaskResponseOut();
		taskRes.setId(id);
		taskRes.setResponse(response);
		taskRes.setTaskId(taskId);
		taskRes.setUserId(userId);
		
		
		DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
		taskRes.setResponseTime(sdf.format(responseTime));
		
		return taskRes;
		
	}
    
}
